package com.bawei.websocketdemo;

import android.util.Log;

import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.handshake.ServerHandshake;

import java.net.URI;

/**
 * @Author : yaotianxue
 * @Time : On 2023/6/25 15:43
 * @Description : JWebSocketClient
 */
public class ZWebSocketClient extends WebSocketClient {
    public ZWebSocketClient(URI serverUri) {
        super(serverUri,new Draft_6455());
    }

    @Override
    public void onOpen(ServerHandshake handshakedata) {
        Log.d("ytx", "onOpen: ");
    }

    @Override
    public void onMessage(String message) {
        Log.d("ytx", "onMessage: ");

    }

    @Override
    public void onClose(int code, String reason, boolean remote) {
        Log.d("ytx", "onClose: ");
    }

    @Override
    public void onError(Exception ex) {
        Log.d("ytx", "onError: ");
    }
}
